package va_file;

import java.io.IOException;

import bufmgr.*;
import global.*;
import heap.FieldNumberOutOfBoundException;
import heap.HFBufMgrException;
import heap.HFDiskMgrException;
import heap.HFException;
import heap.InvalidTupleSizeException;
import heap.InvalidTypeException;
import index.IndexException;
import iterator.*;
import va.BaseRSIndexScan;

public class RSIndexScan extends BaseRSIndexScan {

	public RSIndexScan(IndexType index,
			String relName,
			String indexName,
			AttrType[] types,
			short[] str_sizes,
			int noInFields,
			int noOutFields,
			FldSpec[] outFields,
			CondExpr[] selects,
			int fldNum,
			Vector100Dtype target,
			int distance,
            int noOfBits) throws IndexException, HFException, HFBufMgrException, HFDiskMgrException, IOException, InvalidTupleSizeException, InvalidTypeException, FileScanException, TupleUtilsException, InvalidRelation, JoinsException, PageNotReadException, PredEvalException, UnknowAttrType, FieldNumberOutOfBoundException, WrongPermat, PageUnpinnedException, InvalidFrameNumberException, HashEntryNotFoundException, ReplacerException {
        super(index, relName, indexName, types, str_sizes, noInFields, noOutFields, outFields, selects, fldNum, target, distance, noOfBits);

		VAFile file = new VAFile(indexName);
		VAFileScan scan = file.openVAScan();
		this.rids = scan.VAFileRangeScan(target, distance, noOfBits);
        scan.close();
	}

}
